﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManageAdvertise.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.ManageAdvertise" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script runat="server" language="C#">

	// We are not using a code behind page here just for simplicity in the
	// sample file. In this way we don't have to distribute a compiled DLL for
	// this page. In real cases, the following code will instead be defined in
	// a code behind file.

	protected override void OnLoad( EventArgs e )
	{
		CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
		_FileBrowser.BasePath = "../../ckfinder/";
        _FileBrowser.SetupCKEditor(CKEditor1);
	}

</script>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý quảng cáo</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <asp:Label ID="Label1" runat="server" Text="Label" ForeColor="#CC0000" Visible="False"></asp:Label>
                    <table>
                        <tr>
                            <td>
                                Tên quảng cáo:
                            </td>
                            <td>
                                <asp:TextBox ID="txtTen" runat="server" Width="250px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="(*)"
                                    ControlToValidate="txtTen"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Vị trí quảng cáo:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlVitri" runat="server" Width="256px">
                                    <asp:ListItem>-----Chọn vị trí-----</asp:ListItem>
                                    <asp:ListItem>Banner Advertise</asp:ListItem>
                                    <asp:ListItem>Banner Right</asp:ListItem>
                                    <asp:ListItem>Banner Top</asp:ListItem>
                                    <asp:ListItem>Banner Left</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Nội dung:
                            </td>
                            <td>
                               <CKEditor:CKEditorControl ID="CKEditor1" runat="server" Width="600px"></CKEditor:CKEditorControl>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="CKEditor1"
                                    ErrorMessage="(*)"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Hiển thị ra trang chủ:</td>
                            <td>
                                <asp:CheckBox ID="CheckBox1" runat="server" />
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="btnSua" runat="server" Text="Lưu lại" OnClick="btnSua_Click" 
                                    CssClass="altbutton" />
                                &nbsp;<asp:Button ID="btnHuy" runat="server" Text="Hủy bỏ" 
                                    CssClass="altbutton" onclick="btnHuy_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="Panel1" runat="server">
                    <asp:CheckBox ID="cbCheckAll" runat="server" Text="Check All" AutoPostBack="True"
                        OnCheckedChanged="cbCheckAll_CheckedChanged" />
                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" OnClick="btnDelete_Click" 
                        CssClass="altbutton" 
                        OnClientClick="javascript:return confirm('Bạn có muốn xóa?')" />
                    <asp:Button ID="btnAdd" runat="server" CssClass="altbutton" Text="Thêm mới" 
                        PostBackUrl="~/Administrator/ThemQuangCao.aspx" />
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                        DataSourceID="LinqDataSource1" EnableModelValidation="True" Style="margin-top: 0px"
                        OnSelectedIndexChanged="GridView1_SelectedIndexChanged" CellPadding="4" ForeColor="#333333"
                        GridLines="None" Width="920px" AllowPaging="True" AllowSorting="True">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbCheck" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ID" HeaderText="Số thứ tự" InsertVisible="False" ReadOnly="True"
                                SortExpression="ID">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Name" HeaderText="Tên" SortExpression="Name">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Position" HeaderText="Vị trí" SortExpression="Position">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:CheckBoxField DataField="IsFrontPage" HeaderText="Hiển thị ở Trang chủ" SortExpression="IsFrontPage">
                                <HeaderStyle Width="100px" HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:CheckBoxField>
                            <asp:TemplateField Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Content") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DAL_Class.NLLDataContext"
                        TableName="Advertises">
                    </asp:LinqDataSource>
                    <asp:Label ID="lblSuccess" runat="server" ForeColor="#CC0000" Text="Label" Visible="False"></asp:Label>
                </asp:Panel>
            </div>
        </div>
    </div>
</div>
